﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.quest.Display {
    import flash.events.*;
    import Display.DialogUI.*;
    import org.aswing.*;
    import Classes.*;
    import Classes.util.*;
    import Classes.sim.*;
    import org.aswing.event.*;
    import Modules.guide.ui.*;
    import Display.aswingui.*;

    public class QuestFreeGiftsDialog extends InviteFriendsGuideDialog {

        public function QuestFreeGiftsDialog(_arg1:Object){
            super(ZLoc.t("Quest", _arg1.message), ZLoc.t("Quest", _arg1.title), GenericDialogView.TYPE_SENDGIFTS, null, true, _arg1.npcEpilogueUrl, "", null);
        }
        override protected function onSkip(_arg1):void{
            IdleDialogManager.markDialogAsSkipped(IdleDialogManager.IDLE_SENDGIFT);
            MiniQuestManager.giftsSkipped = true;
            super.onSkip(_arg1);
        }
        public function onSkipClicked(_arg1:Event):void{
        }
        override public function close():void{
            Global.player.setAllowQuests(true);
            Global.questManager.refreshActiveIconQuests();
            super.close();
        }
        override protected function onPanelClick(_arg1:AWEvent):void{
            FrameManager.navigateTo("gifts.php?ref=free_gift_icon");
            this.close();
            dispatchEvent(new Event(Event.CLOSE, true));
        }
        override protected function createButtonPanel():JPanel{
            var _local2:CustomButton;
            var _local1:JPanel = ASwingHelper.makeSoftBoxJPanel(SoftBoxLayout.CENTER);
            if (m_SkipCallback != null){
                _local2 = new CustomButton(ZLoc.t("Dialogs", "Skip"), null, "GreyButtonUI");
                _local2.setPreferredWidth(100);
                _local2.setMinimumWidth(100);
                _local2.setMaximumWidth(100);
                _local2.addActionListener(this.onSkip, 0, true);
                _local1.append(_local2);
                _local1.append(ASwingHelper.horizontalStrut(5));
            };
            m_button = new CustomButton(ZLoc.t("Dialogs", "SendFreeGifts"), null, "GreenButtonUI");
            m_button.addActionListener(this.onPanelClick, 0, true);
            _local1.append(m_button);
            return (_local1);
        }

    }
}//package Modules.quest.Display 
